package com.shiroha.common.feign.client;

import com.shiroha.common.pojo.dto.ChatGroupDTO;
import com.shiroha.common.pojo.dto.UserDTO;
import com.shiroha.common.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.UUID;

@FeignClient(name = "user-service")
public interface UserClient {

    @PostMapping("/us/users")
    Boolean createUser(@RequestBody UserDTO userDTO);

    @PutMapping("/us/users")
    Boolean updateUser(@RequestBody UserDTO userDTO);

    @GetMapping("/us/groups")
    Result<List<ChatGroupDTO>> getAllGroupsByUserId(@RequestParam UUID userId);

    @GetMapping("/us/groups/{groupId}")
    Result<ChatGroupDTO> getGroupByGroupId(@PathVariable("groupId") Long groupId);

    @GetMapping("/us/group/{groupId}/members/ids")
    Result<UUID[]> getMemberIdsByGroupId(@PathVariable("groupId") Long groupId);
}
